<%@ page language="java" pageEncoding="utf-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>



<jsp:include page="../common/common.jsp">

	<jsp:param name="title" value="审批用户列表"/>

</jsp:include>



<div class="page-header">

	<h1>

		审批用户列表

	</h1>

</div>



<div class="row">

	<div class="col-xs-12">

		<div class="row">

			<div class="col-xs-12">

				<div>

					<div class="dataTables_wrapper form-inline no-footer">

						<table id="_table" class="table table-striped table-bordered table-hover dataTable no-footer">

						</table>

					</div>

				</div>

			</div>

		</div>

	</div>

</div>



<script type="text/javascript">

	$('.page-content-area').ace_ajax('loadScripts', scripts, function() {

		jQuery(function($) {

			// 列表(jquery.table.min.js中定义了table)

    		var $table = $("#_table").table({

    			//请求后台的URL（*）

    			url : "${_path}/admin/userAudit/list",

    			//formId : "_form",

				tools : [

					{text : '通过', clazz : 'btn-success', icon : 'fa fa-user-plus green', permission : '/admin/userAudit/accept', handler : function(){

						$table.ajaxEnable({url : "${_path}/admin/userAudit/accept"}, true);

					}},

					{text : '拒绝', clazz : 'btn-danger', icon : 'fa fa-user-times red', permission : '/admin/userAudit/refuse', handler : function(){

						$table.ajaxDelete({

							confirm : "确认拒绝申请?",

							url : "${_path}/admin/userAudit/refuse"

						});

					}}

				],

				//表格的列

				columns : [

			        {field:'id', hide : true},

			        {field:'account', title:'注册用户名'},

			        {field:'roleNames', title:'角色'},

			        {field:'registerTime', title:'申请时间', mobileHide : true},

			        {field:'message', title:'留言', mobileHide : true}

				],

				operate : [

					{text : '通过', clazz : 'green', icon : 'fa fa-user-plus', permission : '/admin/userAudit/accept', 

						handler : function(){

							$table.ajaxEnable({url : "${_path}/admin/userAudit/accept"}, true);

						},
					},

					{text : '拒绝', clazz : 'red', icon : 'fa fa-user-times', permission : '/admin/userAudit/refuse', handler : function(d, i){

						$table.ajaxDelete({

							confirm : "确认拒绝申请?",

							url : "${_path}/admin/userAudit/refuse"

						});

					}}

				],

				after : function(){

					// 权限处理

					$.permission();

				}

			});

			

			//搜索

			$(".search-data").keyup(function () { 

				$table.search();

			});

            

			// 取消

			$("#_cancel").click(function(){

				$table.search();

			});

		});

	});

</script>